home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Gui4Cli / Dir / dir.ppShow < prev    next >
Encoding:
Text File  |  1980-01-03  |  5.7 KB  |  238 lines

  1. G4C 
  2.  
  3. ; this is a GUI for the excellent and free Graphics and ANIM player PPShow 4
  4. ; (it also works with older versions of ppshow)
  5.  
  6.  
  7. WINBIG   -1 30 340 132 "PPShow 4.0 GUI"
  8. wintype  11110001          ; a resizable window
  9. ;winbackground icon guis:info/bgnds/tile 0
  10. varpath dir.gc
  11.  
  12. ;============================> Some Graphics (to fill in space)
  13.  
  14. box 0 0 0 0 IN ICONDROP
  15.  
  16. LINE 6 65 332 65 1
  17. LINE 6 67 332 67 2
  18.  
  19. LINE 6 100 332 100 1
  20. LINE 6 102 332 102 2
  21.  
  22. ;============================> AppWindow
  23.  
  24. xONLOAD                ; Set the default values of our vars
  25. setscreen dir.ppshow $*SCREEN
  26. pps_mode    = PAL        ; screen mode
  27. pps_res     = ""        ; resolution 
  28. pps_play    = ""        ; loop/repeat
  29. pps_lace    = ""        ; interlace or not (use default)
  30. pps_flick   = ""        ; flicker fix (use default)
  31. pps_datt    = ""        ; use datatypes
  32. pps_mouse   = NOMOUSE        ; no mouse
  33. pps_oscn    = ""        ; overscan (use default)
  34. pps_cycle   = ""        ; cycle (use default)
  35. pps_noan    = ""           ; display animations
  36. pps_jifs    = 0            ; Jiffies -> 0 = use default
  37. pps_times   = 100        ; play anims 100 times
  38. pps_time    = 60        ; show pics for 60 secs each
  39. guiopen dir.ppshow
  40.  
  41. xonclose
  42. guiquit dir.ppshow
  43.  
  44. xonfail
  45. guiquit dir.ppshow
  46.  
  47. ;====================> Declare a cycler, to let the user
  48. ;                      choose the type of monitor.
  49.  
  50. xCYCLER 205 5 121 12 "" pps_mode
  51. CSTR  PAL     PAL
  52. CSTR  A2024   A2024
  53. CSTR  15Hz    15Hz
  54. CSTR  NTSC    NTSC
  55. CSTR  VGA     VGA
  56. CSTR  SUPER72 SUPER72
  57.  
  58. ;Note that we set the PAL first. That's because I use PAL, and want it
  59. ;as default - change it around if you want otherwise.
  60.  
  61. ;===================> An other cycler for the Resolution Modes
  62.  
  63. xCYCLER 60 5 125 12 Res. pps_res
  64. CSTR  Default      ""
  65. CSTR  LOW          LO
  66. CSTR  HIGH         HI
  67. CSTR  "Super HIGH" SHI
  68. CSTR  Productive   PROD
  69. CSTR  HAM          HAM
  70.  
  71. ;===================> Cycler for Loop/Repeat/Single play of anims
  72.  
  73. xCYCLER 205 20 121 12 "" pps_play
  74. CSTR  SINGLE  ""
  75. CSTR  LOOP    LOOP
  76. CSTR  REPEAT  R
  77.  
  78. ;====================> Declare some checkbox button for lace, mouse, oscn etc
  79.  
  80. xCHECKBOX 60  20 26 11 Lace   pps_lace  L      NL      OFF
  81. xCHECKBOX 140 20 26 11 NoFlk  pps_flik  NF     ""      OFF
  82. xCHECKBOX 60  35 26 11 DTyp   pps_datt  DT     ""      OFF
  83. xCHECKBOX 140 35 26 11 Mouse  pps_mouse ""     NOMOUSE OFF
  84. xCHECKBOX 220 35 26 11 Oscn   pps_oscn  MO     NO      OFF
  85. xCHECKBOX 300 35 26 11 Cycle  pps_cycle CYCLE  ""      OFF
  86.  
  87.  
  88. ;-----> Slider for Time (seconds to show each picture)
  89.  
  90. xHSLIDER 60 50 200 11 Time pps_time  1 999  60  "%3ld Sec."
  91. GadID 10
  92.  
  93.  
  94. ;=================== ANIMATION OPTIONS ==============================
  95.  
  96. ;----> Checkbox for Animation ON/OFF (also jifs/times slider ON/OFF)
  97.  
  98. xCHECKBOX 60 73 26 11 Anim pps_noan  "" NOANIM  ON
  99. if $pps_noan = ""
  100.    SetGad dir.ppshow 15 ON
  101.    setgad dir.ppshow 11 ON
  102. else
  103.    SetGad dir.ppshow 15 OFF
  104.    setgad dir.ppshow 11 OFF
  105. endif
  106.  
  107.  
  108. ;----> Slider for speed
  109.  
  110. xHSLIDER 87 73 170 11 "" pps_jifs 0 10 0 "%2ld Jfs"
  111. GadID 15
  112.  
  113.  
  114. ;-----> Slider for Times to play
  115.  
  116. xHSLIDER 60 86 200 11 Times pps_times 1 999  100 "%3ld"
  117. GadID 11
  118.  
  119.  
  120. ;=========================== Play the mess!
  121. ; Here we use some tricks to feed the files to ppshow 20 at a time, so
  122. ; we don't load and reload ppshow for every file. We use xOnReturn to 
  123. ; re-launch ppshow when it's done showing each batch of files
  124.  
  125.  
  126. xbutton 15 110 80 15 PLAY
  127. id  = $$LV.ID            ; get the listview's id
  128. if $$LV.GUI == dir.gc        ; check that it's dir.gc calling
  129.    else
  130.    ezreq "Choose files from DIR.GC" OK ""
  131. endif
  132. lvmulti first            ; get first file
  133. if $lv_file = ""            ; if no files selected
  134.    ezreq "No files chosen!" OK ""
  135. endif
  136. if $$LV.TYPE != FILE
  137.    ezreq "Please choose files\nnot directories." OK ""
  138. endif
  139. cd $$LV.DIR            ; cd to the current directory
  140. pps_abort = 0            ; a flag to tell us to stop
  141.  
  142. ; ok.. now collect the first 20 files
  143. pps_num   = 0            ; start a counter
  144. pps_files = ""
  145. while $pps_num < 20
  146.       extract lv_file ext pps_ext
  147.       if $pps_ext == .info
  148.          ; do nothing
  149.       else
  150.          extract lv_file file pps_file 
  151.          appvar pps_files ' $pps_file'
  152.          counter pps_num inc 1
  153.       endif
  154.       lvmulti next
  155.       if $lv_file = ""        ; no more files
  156.          pps_num = 20
  157.          pps_abort = 1
  158.       else
  159. endwhile
  160. gosub dir.ppshow makecom
  161. launch 1 'c:ppshow >nil: $pps_files $pps_com'
  162.  
  163.  
  164. xOnReturn 1
  165. if $pps_abort = 1        ; check Stop flag
  166.    stop
  167. endif
  168. pps_num   = 0            ; re-start counter
  169. pps_files = ""
  170. lvmulti next
  171. if $lv_file = ""
  172.    stop
  173. endif
  174. while $pps_num < 20
  175.       extract lv_file ext pps_ext
  176.       if $pps_ext == .info
  177.          ; do nothing
  178.       else
  179.          extract lv_file file pps_file 
  180.          appvar pps_files ' $pps_file'
  181.          counter pps_num inc 1
  182.       endif
  183.       lvmulti next
  184.       if $lv_file = ""        ; no more files
  185.          pps_num = 20
  186.          pps_abort = 1
  187.       else
  188. endwhile
  189. gosub dir.ppshow makecom
  190. launch 1 'c:ppshow >nil: $pps_files $pps_com'
  191.  
  192.  
  193. ; ---------- Abort after returning from current ppshow launch (set flag)
  194.  
  195. xbutton 255 110 70 15 Stop
  196. pps_abort = 1
  197.  
  198.  
  199. ; ----------- Routine to construct the rest of the command line
  200.  
  201. xRoutine makecom
  202. pps_com = $pps_mode        ; screen mode
  203. if $pps_res > ""
  204.    appvar pps_com ' $pps_res'    ; screen resolution
  205. endif
  206. if $pps_play > ""
  207.    appvar pps_com ' $pps_play'    ; play single/loop etc for anims
  208. endif
  209. appvar pps_com ' $pps_lace'    ; interlace or not
  210. if $pps_flick > ""
  211.    appvar pps_com ' $pps_flick'    ; ficker fix
  212. endif
  213. if $pps_datt > ""
  214.    appvar pps_com ' $pps_datt'    ; use datatypes
  215. endif
  216. if $pps_mouse > ""
  217.    appvar pps_com ' $pps_mouse'    ; show mouse ?
  218. endif
  219. appvar pps_com ' $pps_oscn'    ; max or no overscan ?
  220. if $pps_cycle > ""
  221.    appvar pps_com ' $pps_cycle'    ; cycle
  222. endif
  223. appvar pps_com ' TIME=$pps_time'    ; time to play pics
  224. if $pps_noan = ""            ; i.e. display animations
  225.    if $pps_jifs > 0            ; 0 = use default
  226.       appvar pps_com ' J=$pps_jifs'
  227.    endif
  228.    appvar pps_com ' T=$pps_times'    ; times to play anim
  229. endif
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.